"""
@Time   : 2024/8/16 上午8:53
@Auther : hwx
@Desc   : 自定义异常类
"""


class MyException(Exception):
    def __init__(self, msg):
        self.msg = msg

    def __str__(self):
        return self.msg


if __name__ == '__main__':
    # 测试效果
    try:
        raise MyException("自定义异常")
    except MyException as e:
        print(e)
